/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface FtdsSzcx extends BasicModel<FtdsSzcx> {
  szcxSfzh?: string; // 身份证号
  szcxSfsz?: string; // 是否涉执
}

export const ftdsSzcxList = (params?: FtdsSzcx | any) =>
  defHttp.get<FtdsSzcx>({ url: adminPath + '/operating/ftdsSzcx/list', params });

export const ftdsSzcxListData = (params?: FtdsSzcx | any) =>
  defHttp.post<Page<FtdsSzcx>>({ url: adminPath + '/operating/ftdsSzcx/listData', params });

export const ftdsSzcxForm = (params?: FtdsSzcx | any) =>
  defHttp.get<FtdsSzcx>({ url: adminPath + '/operating/ftdsSzcx/form', params });

export const ftdsSzcxSave = (params?: any, data?: FtdsSzcx | any) =>
  defHttp.postJson<FtdsSzcx>({ url: adminPath + '/operating/ftdsSzcx/save', params, data });

export const ftdsSzcxImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/operating/ftdsSzcx/importData',
      onUploadProgress,
    },
    params,
  );

export const ftdsSzcxDelete = (params?: FtdsSzcx | any) =>
  defHttp.get<FtdsSzcx>({ url: adminPath + '/operating/ftdsSzcx/delete', params });
